import request from '@/utils/request'

/**
 * 获取用户草稿箱数据
 * id 草稿箱唯一id
 * module 路由模块路径
 * method 操作方法
 */
export function getDraft(id = '', module = '', method = '') {
  return request({
    url: '/kmpt/biz/draft/get',
    method: 'get',
    // requestBase:'VUE_APP_MANAGEMENT_API',
    headers: { 'Content-Type': 'multipart/form-data' },
    params: {
      id: id,
      module: module,
      method: method
    }
  })
}

/**
 * 保存草稿箱
 * @param {Object} data
 */
export function saveDraft(data) {
  return request({
    url: '/kmpt/biz/draft/save',
    method: 'post',
    data
  })
}

export const delDraft = (id) => request.delete('/kmpt/biz/draft/delete?id=' + id, {
  // requestBase:'VUE_APP_BUSINESS_API',
})
